package com.xiaoshuidi.cloud.module.rooms.mapper;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.xiaoshuidi.cloud.module.rooms.pojo.RoomDevicePrice;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.mapstruct.Mapper;

import java.util.List;

/**
 * <p>
 * 水电费设置表 Mapper 接口
 * </p>
 *
 * @author James
 * @since 2023-06-07
 */

public interface RoomDevicePriceMapper extends BaseMapper<RoomDevicePrice> {

    @Select("select rsdp.* from room_sdiot_device_price rsdp LEFT JOIN room_sdiot_device_price_association rsdpa " +
            "on rsdp.id=rsdpa.device_price_id where ${ew.sqlSegment}")
    RoomDevicePrice getDeviceByRoomId(@Param("ew") QueryWrapper<?> wrapper);
}
